package com.qihetimes.earthangel.controller;

import com.qihetimes.earthangel.common.ResponseResult;
import com.qihetimes.earthangel.service.impl.UploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 上窜控制器
 *
 * @author ：f4cklangzi@gmail.com
 * @date ：Created At 2021/12/11
 */
@Slf4j
@Api(tags = "上传模块")
@RestController
@RequestMapping("/api/upload")
public class UploadController {
    
    @Resource
    private UploadService uploadService;
    
    @ApiOperation(value = "获取七牛上传凭证")
    @GetMapping("/uploadToken")
    public ResponseResult<String> uploadToken() {
        String token = uploadService.uploadToken();
        return ResponseResult.success(token);
    }
    
}
